*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*	This is the Master program for "Credible School Value-Added with Undersubscribed School Lotteries"
*	Running each of these files will replicate the results beginning from the raw data inputs.
*   See the called master files for a description of code processes. The analysis master files describe how code
*	files map to the exhibits of the paper.
*	----------------------------------------------------------------------------

	clear all

*	paths

	local codedir 				"A:/VAM2/`c(username)'"

	* code directory
	global code_clean_DEN		"`codedir'/code/clean-DEN/"
	global code_clean_NYC 		"`codedir'/code/clean-NYC/"
	global code_clean_NYCms		"`codedir'/code/clean-NYC-MS/"
	global code_build	 		"`codedir'/code/build/"
	global code_analysis 		"`codedir'/code/analysis/"

	* data directory
	global data_raw_DEN			"D:/denver/raw/"
	global data_raw_NYC			"D:/nyc/raw/"
	global data_raw_NYCms		"D:/nyc/raw/"

	global data_clean_DEN		"D:/denver/VAM2/`c(username)'/clean/"
	global data_clean_NYC		"D:/nyc/VAM2/`c(username)'/clean/"
	global data_clean_NYCms		"D:/nyc/VAM2/`c(username)'/clean/"

	global data_build_DEN		"D:/denver/VAM2/`c(username)'/build/"
	global data_build_NYC		"D:/nyc/VAM2/`c(username)'/build/"
	global data_build_NYCms		"D:/nyc/VAM2/`c(username)'/build/"

	global tables 				"`codedir'/output/tables/"
	global figures 				"`codedir'/output/figures/"
	global log	 				"`codedir'/output/logs/"

	global ado 					"`codedir'/code/ado/"
	adopath ++ 	"$ado"

	*	switches

		local clean_DEN				1	// clean raw Denver data
		local clean_NYCms			1	// clean raw NYC middle school data
		local clean_NYC				1	// clean raw NYC high school data
		local build_DEN				1	// build Denver analysis file
		local build_NYCms			1	// build NYC middle school analysis file
		local build_NYC				1	// build NYC high school analysis file
		local analysis_DEN			1	// get Denver results
		local analysis_NYCms		1	// get NYC middle school results
		local analysis_NYC			1	// get NYC high school results

	*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	*	do

		if `clean_DEN'					do "${code_clean_DEN}0c_master"

		if `clean_NYCms'				do "${code_clean_NYCms}0c_master"

		if `clean_NYC'					do "${code_clean_NYC}0c_master"

		if `build_DEN'					do "${code_build}0b_master_DEN"

		if `build_NYCms'				do "${code_build}0b_master_NYCms"

		if `build_NYC'					do "${code_build}0b_master_NYC"

		if `analysis_DEN'				do "${code_analysis}0a_master_DEN"

		if `analysis_NYCms'				do "${code_analysis}0a_master_NYCms"

		if `analysis_NYC'				do "${code_analysis}0a_master_NYC"
